{extend name="normal_base" /}
{block name="navigation"}{/block}
{block name="body"}
<div class="x-body layui-anim layui-anim-up">
    <blockquote class="layui-elem-quote">欢迎管理员：
        <span class="x-green1">{$user_info['username']}</span>！&nbsp;&nbsp;上次登录时间：<span class="x-green1">{$user_info['last_login_time'] ? date('Y-m-d H:i:s', $user_info['last_login_time']) : ''}</span> &nbsp;&nbsp;上次登录ip：<span class="x-green1">{$user_info['last_login_ip']}</span class="x-green"></blockquote>
    <fieldset class="layui-elem-field">
        <legend>数据统计</legend>
        <div class="layui-field-box">
            <div class="layui-col-md12">
                <div class="layui-card">
                    <div class="layui-card-body">
                        <div class="layui-carousel x-admin-carousel x-admin-backlog" lay-anim="" lay-indicator="inside" lay-arrow="none" style="width: 100%; height: 90px;">
                            <div carousel-item="">
                                <ul class="layui-row layui-col-space10 layui-this">
                                    <li class="layui-col-xs4">
                                        <a _href="{:url('admin/contract/index')}" class="x-admin-backlog-body">
                                            <h3>合同数量</h3>
                                            <p>
                                                <cite>{$contract_counts}</cite></p>
                                        </a>
                                    </li>
                                    <li class="layui-col-xs4">
                                        <a href="javascript:;" class="x-admin-backlog-body">
                                            <h3>客户数量</h3>
                                            <p>
                                                <cite>{$customer_counts}</cite></p>
                                        </a>
                                    </li>
                                    <li class="layui-col-xs4">
                                        <a href="javascript:;" class="x-admin-backlog-body">
                                            <h3>系统人员数量</h3>
                                            <p>
                                                <cite>{$admin_user_counts}</cite></p>
                                        </a>
                                    </li>
                                </ul>
                            </div>
                        </div>
                    </div>
                </div>
            </div>
        </div>

        <div class="layui-field-box">
            <div class="layui-col-md6">
                <div id="count-contract" style="width: 350px;height:350px;"></div>
            </div>
            <div class="layui-col-md6">
                <div id="count-customer"  style="width: 350px;height:350px;"></div>
            </div>
        </div>

    </fieldset>
    <fieldset class="layui-elem-field">
        <legend>系统通知</legend>
        <div class="layui-field-box">
            <table class="layui-table" lay-skin="line">
                <tbody>
                <tr>
                    <td >
                        合同系统 1.0试用版发布
                    </td>
                </tr>
                </tbody>
            </table>
        </div>
    </fieldset>
    <fieldset class="layui-elem-field">
        <legend>系统信息</legend>
        <div class="layui-field-box">
            <table class="layui-table">
                <tbody>
                <tr>
                    <th>系统版本</th>
                    <td>1.0.0</td></tr>
                <tr>
                    <th>网站域名</th>
                    <td>{$config.url}</td></tr>
                <tr>
                    <th>网站目录</th>
                    <td>{$config.document_root}</td></tr>
                <tr>
                    <th>服务器操作系统</th>
                    <td>{$config.server_os}</td></tr>
                <tr>
                    <th>服务器端口</th>
                    <td>{$config.server_port}</td></tr>
                <tr>
                    <th>服务器环境</th>
                    <td>{$config.server_soft}</td></tr>
                <tr>
                    <th>MYSQL版本</th>
                    <td>{$config.mysql_version}</td></tr>
                <tr>
                    <th>最大上传限制</th>
                    <td>{$config.max_upload_size}</td></tr>
                </tbody>
            </table>
        </div>
    </fieldset>
    <fieldset class="layui-elem-field">
        <legend>开发团队</legend>
        <div class="layui-field-box">
            <table class="layui-table">
                <tbody>
                <tr>
                    <th>开发者</th>
                    <td>圣泉山人(577026014@qq.com)</td></tr>
                </tbody>
            </table>
        </div>
    </fieldset>
</div>
{/block}
{block name="script"}
<script src="__JS__/echarts.min.js"></script>

<!--合同统计图-->
<script>
    // 基于准备好的dom，初始化echarts实例
    var myChart = echarts.init(document.getElementById('count-contract'));

    // 指定图表的配置项和数据
    option = {
        title: {
            text: '合同统计',
            left: '50%',
            textAlign: 'center',
        },
        tooltip: {
            trigger: 'item',
            formatter: "{a} <br/>{b} : {c} ({d}%)"
        },
        series: [{
            name: '合同统计',
            type: 'pie',
            radius: '68%',
            center: ['50%', '50%'],
            clockwise: false,
            data: {$count_contract_json},
            label: {
                normal: {
                    textStyle: {
                        color: '#999',
                        fontSize: 14,
                    }
                }
            },
            labelLine: {
                normal: {
                    show: false
                }
            },
            itemStyle: {
                normal: {
                    borderWidth: 4,
                    borderColor: '#ffffff',
                },
                emphasis: {
                    borderWidth: 0,
                    shadowBlur: 10,
                    shadowOffsetX: 0,
                    shadowColor: 'rgba(0, 0, 0, 0.5)'
                }
            }
        }],
        color: [
            '#00acee',
            '#52cdd5',
            '#79d9f1',
            '#a7e7ff',
            '#c8efff'
        ],
        backgroundColor: '#fff'
    };

    // 使用刚指定的配置项和数据显示图表。
    myChart.setOption(option);
</script>

<!--客户统计图-->
<script>
    // 基于准备好的dom，初始化echarts实例
    var myChart = echarts.init(document.getElementById('count-customer'));

    // 指定图表的配置项和数据
    option = {
        title: {
            text: '客户统计',
            left: '50%',
            textAlign: 'center',
        },
        tooltip: {
            trigger: 'item',
            formatter: "{a} <br/>{b} : {c} ({d}%)"
        },
        series: [{
            name: '客户统计',
            type: 'pie',
            radius: '68%',
            center: ['50%', '50%'],
            clockwise: false,
            data: {$count_customer_json},
            label: {
                normal: {
                    textStyle: {
                        color: '#999',
                        fontSize: 14,
                    }
                }
            },
            labelLine: {
                normal: {
                    show: false
                }
            },
            itemStyle: {
                normal: {
                    borderWidth: 4,
                    borderColor: '#ffffff',
                },
                emphasis: {
                    borderWidth: 0,
                    shadowBlur: 10,
                    shadowOffsetX: 0,
                    shadowColor: 'rgba(0, 0, 0, 0.5)'
                }
            }
        }],
        color: [
            '#00acee',
            '#52cdd5',
            '#79d9f1',
            '#a7e7ff',
            '#c8efff'
        ],
        backgroundColor: '#fff'
    };

    // 使用刚指定的配置项和数据显示图表。
    myChart.setOption(option);
</script>

{/block}